﻿@{
    ViewBag.Title = "Wiki";
    Layout = "~/Views/Shared/LayoutWiki.cshtml";
}

<style type="text/css">
    #a1 {
        float: left;
        width: 700px;
    }
</style>
<div id="a1">
<div id="WikiTable"></div>
<script type="text/javascript" src="@Url.Content("/Scripts/knockout-2.2.1.js")"></script>
    <script type="text/javascript">  
        $(document).ready(function () {

            $('#WikiTable').jtable({
                paging: true,
                pageSize: 10,
                actions: {
                    listAction: '/Wiki/GetListWikiModel',
                },
                fields: {
                    Id:{
                        list: false
                    },
                    Subject: {
                        title: 'Subject',
                        key: true,
                        create: false,
                        edit: false,
                        width: '23%',
                    },             
                    Body: {
                        title: 'Content',
                        width: '60%'
                    },

                    CustomAction: {
                        title: 'View',
                        width: '50px',
                        sorting: false,
                        create: false,
                        edit: false,
                        list: true,
                        display: function (data) {
                            return '<a href="Detail/' + data.record.Id + '">View</a>';
                        }
                    }
                }
            });
            $('#WikiTable').jtable('load');        
        });        
    </script>
</div>